<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-if</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<h1>v-if作用:根据表达式的值来决定当前标签是否显示(操作dom)</h1>
<div id="app">
    <button @click="show = !show">切换</button>
    <h2 v-if="show">v-if</h2>
</div>
<script>
    new Vue({
        el: '#app',
        data: {
            show: true
        }
    })
</script>
</body>
</html>